package edu.ubbcs.rs.backend.model.table;

import edu.ubbcs.rs.backend.model.BaseEntity;
import edu.ubbcs.rs.backend.model.Reservation;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:45
 */
@Entity
@javax.persistence.Table(name = "Tables")
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class Table extends BaseEntity {

    protected int height;
    protected int weight;
    protected int x;
    protected int y;

    public Table() {

    }

    @Column(name = "height")
    public int getHeight() {
        return height;
    }

    @Column(name = "weight")
    public int getWeight() {
        return weight;
    }

    @Column(name = "x")
    public int getX() {
        return x;
    }

    @Column(name = "y")
    public int getY() {
        return y;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    public abstract boolean isReserved(List<Reservation> reservations);

    public abstract List<Reservation> reserve(Reservation reservation);
}
